package com.ysd.lis.controller.eq;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.eq.EqRepairOrder;
import com.ysd.lis.request.CommonPageDto;
import com.ysd.lis.request.eq.EqRepairDto;
import com.ysd.lis.request.eq.EqRepairParam;
import com.ysd.lis.service.eq.EqRepairOrderService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 设备管理-设备类型 前端控制器
 * </p>
 *
 * @author prs
 * @since 2024-08-22
 */
@RestController
@RequestMapping("/api/eq/eqRepairOrder")
public class EqRepairOrderController extends BaseController {

    @Autowired
    EqRepairOrderService eqRepairOrderService;

    @ApiOperation("分页查询")
    @GetMapping("/findRepairOrderPageList")
    public Result findRepairOrderPageList(CommonPageDto pageParam){
        return eqRepairOrderService.findRepairOrderPageList(pageParam);
    }

    @ApiOperation("添加")
    @PostMapping("/addRepairOrder")
    public Result addRepairOrder(@RequestBody EqRepairOrder eqRepairOrder) {
        return eqRepairOrderService.addRepairOrder(eqRepairOrder);
    }
    @ApiOperation("编辑")
    @PostMapping("/updatRepairOrder")
    public Result updatRepairOrder(@RequestBody EqRepairOrder eqRepairOrder) {
        return eqRepairOrderService.updatRepairOrder(eqRepairOrder);
    }

    @ApiOperation("根据ID查")
    @GetMapping("/findEqRepairOrderById")
    public Result findEqRepairOrderById( EqRepairOrder eqRepairOrder) {
        return eqRepairOrderService.findEqRepairOrderById(eqRepairOrder);
    }

    @ApiOperation("添加")
    @PostMapping("/verifyRepairOrder")
    public Result verifyRepairOrder(@RequestBody EqRepairDto dto) {
        return eqRepairOrderService.verifyRepairOrder(dto);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteRepairOrderList")
    public Result batchDeleteRepairOrderList(@RequestBody EqRepairDto dto){
        return  eqRepairOrderService.batchDeleteRepairOrderList(dto);
    }

    @ApiOperation("设备维修分析")
    @GetMapping("/getRepairTjfxByEqType")
    public Result getRepairTjfxByEqType(EqRepairParam param){
        return eqRepairOrderService.getRepairTjfxByEqType(param);
    }

    @ApiOperation("维修工作量统计")
    @GetMapping("/getRepairPersonWorkHours")
    public Result getRepairPersonWorkHours(EqRepairParam param){
        return eqRepairOrderService.getRepairPersonWorkHours(param);
    }

    @ApiOperation("设备维修分析")
    @GetMapping("/getRepairTjfxByEquipt")
    public Result getRepairTjfxByEquipt(EqRepairParam param){
        return eqRepairOrderService.getRepairTjfxByEquipt(param);
    }

    @ApiOperation("维修工作量统计")
    @GetMapping("/getRepairDetailByPerson")
    public Result getRepairDetailByPerson(EqRepairParam param){
        return eqRepairOrderService.getRepairDetailByPerson(param);
    }

    @ApiOperation("设备维修分析")
    @GetMapping("/getRepairDetailByEqType")
    public Result getRepairDetailByEqType(EqRepairParam param){
        return eqRepairOrderService.getRepairDetailByEqType(param);
    }

    @ApiOperation("设备维修分析")
    @GetMapping("/getRepairDetailByEquipt")
    public Result getRepairDetailByEquipt(EqRepairParam param){
        return eqRepairOrderService.getRepairDetailByEquipt(param);
    }


}
